//
//  QNJsbridge+Storage.m
//  JSAPIModule
//
//  Created by sumeng on 2018/3/6.
//

#define QN_callStorage @"callStorage"
#define QN_saveStorage @"saveStorage"
#define QN_removeStorage @"removeStorage"

#import "QNJsbridge+Storage.h"

@implementation QNJsbridge (Storage)

#pragma mark 保存缓存
- (void)saveStorageResponseBlock:(QN_responseBlock)responseBlock {
    [self registerHandler:QN_saveStorage responseBlock:^(id data) {
        responseBlock(data);
    }];
}

#pragma mark 发送缓存
- (void)callStorage:(NSString *)storage responseBlock:(QN_responseBlock)responseBlock {
    [self callHandler:QN_callStorage data:storage responseBlock:^(id data) {
        responseBlock(data);
    }]
}

#pragma mark 移除缓存
- (void)removeStorageResponseBlock:(QN_responseBlock)responseBlock {
    [self registerHandler:QN_removeStorage responseBlock:^(id data) {
        responseBlock(data);
    }];
}
@end
